-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tests for iOS Image Segmenter methods with completion handlers #4830
Added tests for iOS Image Segmenter methods with completion handlers #4830
Conversation
@@ -468,6 +468,45 @@ - (void)imageSegmenter:(MPPImageSegmenter *)imageSegmenter | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this method be moved to "Assert Segmenter Results"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get you. This is the delegate method. Is this comment for something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method should be moved out of the section that contains the test methods. I will move it on import.
MPPImageSegmenter *imageSegmenter = [self createImageSegmenterWithOptionsSucceeds:options]; | ||
|
||
MPPImage *image = [MPPImage imageWithFileInfo:kCatImageFileInfo]; | ||
[imageSegmenter segmentImage:image withCompletionHandler:^(MPPImageSegmenterResult *result, NSError *error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't these test need expectation to ensure that these async blocks execute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Because the method returns only after the completion handler call completes and hence the test gets completed only after the result is returned via the handler. This segment method is synchronous as opposed to the live stream segment method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that's right. I will add a comment so future me does not forget again.
@schmidt-sebastian Just a reminder that this PR is not yet merged. |
Oops :) |
No description provided.